﻿function GetTopVersion(ControlId, value) {
    if (ControlId == null || ControlId == undefined || $("#" + ControlId).length == 0) {
        return;
    }
    $.getJSON("http://admin.yorknet.cn/publish/GetVersion.ashx?jsoncallback=?", function (data) {
        if (data.VersionLevel == value) {
            $("#" + ControlId).text("当前版本为最新");
        }
        else {
            $("#" + ControlId).text("最新的版本为:" + data.VersionLevel);
        }
        setTimeout("$('#" + ControlId + "').text('')", 5000);
    }
    );
    return false;
}
/*
function GetTopNews() {
    //GetBaseInfo.ashx
    //TopNews
    $.getJSON("http://admin.yorknet.cn/publish/GetBaseInfo.ashx?jsoncallback=?", { nodeid: 15, topnum: 5, orderby: " PubTime DESC ", columns: " Url,Name " }, function (data) {
        if (data.Status == "error") {
            var NewTr = $('<tr class="tr_operator"></tr>');
            var newTD = $('<td class="align_l"></td>').text(data.ErrorInfo);
        }
        else {
            $.each(data.InfoList, function (i, n) {
                var newTR = $('<tr class="tr_operator"></tr>'); //定义一个tr
                $('<td class="align_l"></td>').html('<a href="' + n.Url + '" target="_blank">' + n.Name + '</a>').appendTo(newTR);
                $("#TopNews").append(newTR);
            });
        }
    }
    );
}
*/
function YorkNetStatistics() {
    var YorkNetStatisticsFrame = $('<iframe scrolling="no" marginwidth="0" width="100" height="100" frameborder="0" src="http://The Relentless Pursuit Of Perfection/YorkNetStatistics.html" marginheight="0"></iframe>');
    YorkNetStatisticsFrame.hide();
    $("body").append(YorkNetStatisticsFrame);
}
$(document).ready(function () {
    try {
        GetTopNews();
    }
    catch (err) {

    }
    try {
        YorkNetStatistics();
    }
    catch (err) {

    }
});